<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <meta name="page-view-size" content="1280*720">
    <link rel="stylesheet" href="./css/base.css">
    <link rel="stylesheet" href="./css/index.css">
    <script type="text/javascript" src="./lib/js/evm.js"></script>
    <script type="text/javascript" src="./lib/js/Evm_djyw.js"></script>
    <script type="text/javascript" src="./lib/js/key.js"></script>
    <script src="./lib/js/md5.js" type="text/javascript" charset="utf-8"></script>
    <script src="./lib/js/jquery-1.11.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="./lib/js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
    <script src="./js/api.js" type="text/javascript" charset="utf-8"></script>
    <script src="./js/public.js" type="text/javascript" charset="utf-8"></script>
    <style>
      /*首页轮播图*/
      .index-img {
        position: absolute;
        top: 0;
        left: 0;
        opacity: 0;
      }
      .show {
        opacity: 1;
        transition: .5s;
      }
      ul li {
        list-style: none;
        padding: 0px;
        margin: 0px;
        float: left;
      }
      .pagination {
        position: absolute;
        bottom: 20px;
        right: 20px;
        z-index: 999;
      }
      .pagination .dot span {
        display: block;
        margin-right: 5px;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: rgba(255, 255, 255, .5);
      }
      .pagination .dot.show span {
        border-radius: 50%;
        background: rgba(255, 255, 255, .8);
      }
    </style>
</head>


<body>
    <marquee behavior="" direction="" scrollamount='2'>欢迎您进入凤阳县新时代文明实践中心！</marquee>
    <div class="index-bg" id="indexMain">
        <div class="model"></div>
        <div class="model">
          <img class="index-img show" src="images/ad.png">
          <!-- <img class="index-img" src="images/ad1.png" alt="">
            
          <img class="index-img" src="images/ad2.png" alt="">
          <ul class='pagination'>
            <li class="dot show"><span></span></li>
            <li class="dot"><span></span></li>
            <li class="dot"><span></span></li>
          </ul> -->
        </div>
        <div class="model"></div>
        <div class="model"></div>
        <div class="model"></div>
        <div class="model"></div>
        <div class="model"></div>
        <div class="model"></div>
        <div class="model"></div>
        <div class="model"></div>
        <div class="model"></div>
        <div class="model"></div>
        <div class="model"></div>
        <img class="service" src="images/service.png" alt="">

    </div>
</body>
<script src="js/video.js"></script>
<script>
  // <img src="images/index-video.png" alt="">
  // setInterval(function() {
  //   var imgIndex = $('.index-img').index($('.show'));
  //   console.log(imgIndex)
  //   imgIndex = (imgIndex === 2)? 0: ++imgIndex;
  //   for(var i = 0;i < 3;i++){
  //     $('.index-img')[i].className='index-img'
  //     $('.dot')[i].className='dot'
  //   }
  //   $('.index-img').eq(imgIndex).addClass('show')
  //   $('.dot').eq(imgIndex).addClass('show')
  // },4000)


  TV.structure('凤阳县新时代文明实践中心')

  {
    var mp;
    setTimeout(function () {
        try {
            // var mediaStr = "http://10.2.11.145:8800/cms/xuexi.mp4";
            var mediaStr = "http://192.168.3.100/xuexi.mp4";
            //var mediaStr = "http://192.168.1.100/lovefrom.mp4";
            // var videoSize = [79,100,593,360]; //控制位置和宽高的方法 left top width height
                var videoSize = [60, 110, 576, 344]; //控制位置和宽高的方法 left top widht height
            mp = runVideo(mediaStr, videoSize);
        } catch (e) {
            // console.log(e)
        }
    }, 1000);


    var video_number = 0;
    var video_time;
    var dtime;

    setTimeout(function () {
        var loop = setInterval(function () {
            video_number += 2;
          // video_time = mp.getMediaDuration(); //获取视频总秒数的方法
            // setTimeout(function () {
            //     TV.PromptMsg(video_time)
            // }, 8000)
            console.log(video_time);
            if (video_number > video_time - 2) {
                console.log(video_time);
                console.log(video_number)
                // TV.PromptMsg(video_number)
                video_number = 0;
                // TV.PromptMsg(video_number)
                // TV.PromptMsg(video_time)
                mp.playFromStart();
            }
        }, 2000);
    }, 2000)

  }


    var modelIndex = {
        disHeader: true,
        isVideo: true,
        isIndex: true,
        index: 0, //初始位置
        listName: 'model', //模块名称
        containerId: 'indexMain' //包含模块的标签id
    }

    var data = [
        {
            name: '视频地址',
            url: "./pages/play-shouye.html"
        },
        {
            name: '轮播图',
            // url: './pages/user.html'
        },
        {
            name: '文明城市',
            url: './pages/city.html'
        },
        {
            name: '百姓点单',
            url: './pages/orderActivity.html'
        },
        {
            name: '志愿凤阳',
            url: './pages/volunteer.html'
        },
        {
            name: '凤阳好人',
            url: './pages/people.html'
        },
        {
            name: '扫码关注',
            url: ''
        },
        {
            name: '文明实践所',
            url: './pages/shijiansuo.html'
        },
        {
            name: '理论宣讲',
            url: './pages/theory.html'
        },
        {
            name: '文体服务',
            url: './pages/sports.html'
        },
        {
            name: '教育服务',
            url: './pages/education.html'
        },
        {
            name: '科技科普',
            url: './pages/technology.html'
        },
        {
            name: '健康咨询',
            url: './pages/health.html'
        }
        
    ]

    function direOpt(index, directive) {
      if (directive == "up") { //上
        if(index == 12){
          index = 4
        } else if (index >= 0 && index <= 2) {
            index = -1;
        } else if (index == 3 || index == 4) {
            index = 2;
        } else if (index == 5 ) {
            index = 3;
        } else if (index >= 7 && index <= 10) {
            index = 0;
        } else if (index == 11) {
          index = 5;
        }
      } 
      else if (directive == "down") { //下
        console.log("down")
        if(index == 5){
          index = 11
        }else if (index == 0 ) {
            index += 7;
        } else if (index == 2) {
            index  = 3;
        } else if (index == 3 ) {
            index  = 5;
        } else if (index == 4) {
            index = 12;
        } else if (index == -1) {
          index = 2
        }
      } 
      else if (directive == "backwards") { //左
        if (index == 2 || index == 3 || index == 5) {
            index = 0
        } else if (index == 7) {
            index = 5;
        } else if (index > 0) {
          index--
        }

      } else if (directive == 'forwards') { //右
          console.log('rightright')
          if (index == 0) {
            index = 2
          }
          if(index == 5){
            index = 7
          } 
          else if (  0 < index && index < 12) {
            index ++
          }
      }
      //console.log(index)
      return index;
    }

    function direEnter(index) {
        // TV.PromptMsg(getBrowser())
        // mp.stop();
        if (data[index].url) {
            window.location.href = data[index].url
        }
    }
</script>
<script type="text/javascript" src="js/index.js"></script>

</html>